package com.dubito.github.repos.repository

import com.dubito.github.repos.api.ReposApi
import com.dubito.github.repos.model.ReposListModel
import okhttp3.ResponseBody
import retrofit2.Response

/**
 *@Author: liliang
 *@Date: 2020/8/5 5:13 PM
 *
 */
class ReposRepository(private val reposApi: ReposApi) {

    suspend fun searchRepos(query: String, sort: String,order: String, page: Int): ReposListModel
            = reposApi.searchRepos(query, sort,order, page)

    suspend fun checkRepoStarred(owner: String, repo: String): Response<ResponseBody>
            = reposApi.checkRepoStarred(owner, repo)

    suspend fun starRepo(owner: String, repo: String): Response<ResponseBody>
            = reposApi.starRepo(owner, repo)

    suspend fun unStarRepo(owner: String, repo: String): Response<ResponseBody>
            = reposApi.unStarRepo(owner, repo)


}